<?php
/**
 * Created by PhpStorm.
 * User: sunlight
 * Date: 2018/11/21
 * Time: 15:41
 */

namespace app\api\controller;
use app\common\lib\IAuth;
use app\common\lib\Aes;
use think\Controller;

class Test extends Common{

    public function index(){
        return [
            'sdfg',
            'wert'
        ];
    }

    public function save(){
        $data = input('post.');

        // 获取到提交数据 插入库，
        // 给客户端APP  =》 接口数据
        return show(1,'ok',
            (new Aes())->encrypt(json_encode(input('post.'))), 201);
    }

    public  function edit($id=0){
       halt(input('put.'));
    }

    public function token(){
        echo IAuth::setAppLoginToken();
    }

}